package com.gcorp.idealgas.type;

import java.awt.Color;
import java.util.Random;

import com.gcorp.idealgas.Vector2;
import com.gcorp.idealgas.Velocity;

public class StandardMoleculeWithRandomSpeed implements MoleculeType
{
    private Random rand;
    
    private float vx;
    
    private float vy;
    
    private Color color;
    
    public StandardMoleculeWithRandomSpeed()
    {
        rand = new Random();
        
        vx = generateVx();
        vy = generateVy();
        
        color = new Color(255,0,0);
        
    }
    private float generateVx()
    {
    	//int sign = rand.nextBoolean() ? 1 : -1;
        return 0.4f +rand.nextInt()%7f;
    }
    private float generateVy()
    {
    	//int sign = rand.nextBoolean() ? 1 : -1;
        return 0.4f +rand.nextInt()%9f;
    }

    @Override
    public float getMass()
    {
    	
        return 1.5f;
    }

    @Override
    public Color getColor()
    {
        return color;
    }

    @Override
    public float getRadius()
    {
        return 5.5f;
    }

    @Override
    public Velocity getVelocity()
    {
        return new Velocity(vx,vy);
    }
	@Override
	public void reverseX() 
	{
		vx = -vx;
	}
	@Override
	public void reverseY() 
	{
		vy = -vy;
	}
	@Override
	public void setdVx(float vx) 
	{
		this.vx = vx;
	}
	@Override
	public void setdVy(float vy) 
	{
		this.vy = vy;
	}

    
}
